package com.book.utils;

import com.book.entity.Role;
import com.book.entity.User;
import org.apache.shiro.SecurityUtils;

public class SecurityUtil {
	public static User getCurrentUser(){
		return (User) SecurityUtils.getSubject().getSession().getAttribute("currentUser");
	}
	public static Role getCurrentRole(){
		return (Role) SecurityUtils.getSubject().getSession().getAttribute("currentRole");
	}
}
